From: Ian Jackson Date: Fri, 29 Apr 2016 18:10:45 +0000 (+0100) Subject: libxl: Do not trust backend for disk in getinfo X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1046 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=29225b2973c3c5b7ffffc2dc8a972337a37b3283;p=xen.git libxl: Do not trust backend for disk in getinfo Do not read the frontend path out of the backend. We have it in our hand. Likewise the guest (frontend) domid was one of our parameters (!) This is part of XSA-178. Signed-off-by: Ian Jackson Reviewed-by: Wei Liu --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 2ba834bd29..ebf2229fee 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2880,9 +2880,8 @@ int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid, val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path)); diskinfo->rref = val ? strtoul(val, NULL, 10) : -1; diskinfo->frontend = xs_read(ctx->xsh, XBT_NULL, - GCSPRINTF("%s/frontend", diskinfo->backend), NULL); - val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id", diskinfo->backend)); - diskinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1; + GCSPRINTF("%s/frontend", libxl_path), NULL); + diskinfo->frontend_id = domid; GC_FREE; return 0;